import {dataPostRequest, dataPutRequest, deleteRequest, getRequest} from "@/network/axios";

export function getAll(searchItem) {
    return getRequest("/roleInfo/All", searchItem);
}

export function added(roleInfo) {
    return dataPostRequest("/roleInfo/added", roleInfo);
}

export function deleted(id) {
    return deleteRequest("/roleInfo/Deleted", {id: id});
}

export function edited(roleInfo) {
    return dataPutRequest("/roleInfo/Edited", roleInfo);
}

export function addedPower(roleId, menuIds) {
    return dataPostRequest("/PowerInfo/added", {roleId: roleId, menuIds: menuIds});
}

export function getKeys(roleId) {
    return getRequest("/PowerInfo/keys", {roleId: roleId});
}

export function setUserRoles(userId, roleIds) {
    return dataPostRequest("/UserRoles", {userId: userId, roleIds: roleIds});
}